import datacenterRouter from './datacenter/routes'
import taskRoutes from './task/routes'
import configRoutes from './config/routes'
import customerRoutes from './customer/routes'
import dcRouter from './3dc/routes'
const NotFoundCom = resolve => {
        require.ensure(['../NotFoundCom'], () => {
            resolve(require('../NotFoundCom'))
        })
    }
    //保险任务完成情况统计
    //import baseContribution from './KPI/baseContribution'
const insuranceTaskCom = resolve => {
        require.ensure(['./KPI/insuranceTask'], () => {
            resolve(require('./KPI/insuranceTask'))
        })
    }
    //基盘贡献分布
    //import baseContribution from './KPI/baseContribution'
const baseContribution = resolve => {
        require.ensure(['./KPI/baseContribution'], () => {
            resolve(require('./KPI/baseContribution'))
        })
    }
    //基盘车辆车型分布
    //import baseCarModel from './KPI/baseCarModel'
const baseCarModel = resolve => {
        require.ensure(['./KPI/baseCarModel'], () => {
            resolve(require('./KPI/baseCarModel'))
        })
    }
    //基盘车辆年龄分布
    //import baseCarAge from './KPI/baseCarAge'
const baseCarAge = resolve => {
        require.ensure(['./KPI/baseCarAge'], () => {
            resolve(require('./KPI/baseCarAge'))
        })
    }
    //基盘车辆区域分布
    //import baseCarArea from './KPI/baseCarArea'
const baseCarArea = resolve => {
        require.ensure(['./KPI/baseCarArea'], () => {
            resolve(require('./KPI/baseCarArea'))
        })
    }
    //基盘车辆频次分布
    //import baseCarConsumption from './KPI/baseCarConsumption'
const baseCarConsumption = resolve => {
        require.ensure(['./KPI/baseCarConsumption'], () => {
            resolve(require('./KPI/baseCarConsumption'))
        })
    }
    //任务测试

//出保车辆到店率
//import cbCarBack from './KPI/cbCarBack'
const cbCarBack = resolve => {
        require.ensure(['./KPI/cbCarBack'], () => {
            resolve(require('./KPI/cbCarBack'))
        })
    }
    //客户定保到店率
    //import dbCarBack from './KPI/dbCarBack'
const dbCarBack = resolve => {
        require.ensure(['./KPI/dbCarBack'], () => {
            resolve(require('./KPI/dbCarBack'))
        })
    }
    //事故车到店率
    //import carBack from './KPI/carBack'
const carBack = resolve => {
        require.ensure(['./KPI/carBack'], () => {
            resolve(require('./KPI/carBack'))
        })
    }
    //流失月份分析
    //import lostMonth from './KPI/lostMonth'
const lostMonth = resolve => {
        require.ensure(['./KPI/lostMonth'], () => {
            resolve(require('./KPI/lostMonth'))
        })
    }
    //车辆流失分析
    //import carLost from './KPI/carLost'
const carLost = resolve => {
        require.ensure(['./KPI/carLost'], () => {
            resolve(require('./KPI/carLost'))
        })
    }
    //增加产值报表
    //import outputValueStmCom from './KPI/outputValueStm'
const outputValueStmCom = resolve => {
        require.ensure(['./KPI/outputValueStm'], () => {
            resolve(require('./KPI/outputValueStm'))
        })
    }
    // 保养实际到店率
    //import RealMaintainBackCom from './KPI/RealMaintainBackCom'
const RealMaintainBackCom = resolve => {
        require.ensure(['./KPI/RealMaintainBackCom'], () => {
            resolve(require('./KPI/RealMaintainBackCom'))
        })
    }
    // 基盘车辆趋势图
    //import carTrendChsrtsCom from './KPI/carTrendCharts'
const carTrendChsrtsCom = resolve => {
        require.ensure(['./KPI/carTrendCharts'], () => {
            resolve(require('./KPI/carTrendCharts'))
        })
    }
    // 集团统计表
    //import activityForRunXiangCom from './KPI/activityForRunXiang'
const activityForRunXiangCom = resolve => {
    require.ensure(['./KPI/activityForRunXiang'], () => {
        resolve(require('./KPI/activityForRunXiang'))
    })
}

//import lostCarChartsCom from './KPI/lostCarCharts'
const lostCarChartsCom = resolve => {
    require.ensure(['./KPI/lostCarCharts'], () => {
        resolve(require('./KPI/lostCarCharts'))
    })
}


/*凯迪*/
// 客户等级管理
const customeLevelManagementCom = resolve => {
        require.ensure(['./kd/levelDef'], () => {
            resolve(require('./kd/levelDef'))
        })
    }
    // 客户等级设置
const customerManagementRatingCom = resolve => {
    require.ensure(['./kd/levelSet'], () => {
        resolve(require('./kd/levelSet'))
    })
}

// 客户评分项目管理
const customerScoreManagementCom = resolve => {
    require.ensure(['./kd/itemDef'], () => {
        resolve(require('./kd/itemDef'))
    })
}

// 客户评分项目设置
const customerValueSetCom = resolve => {
    require.ensure(['./kd/itemSet'], () => {
        resolve(require('./kd/itemSet'))
    })
}

// 客户评分项目设置
const carReport = resolve => {
    require.ensure(['./kd/carReport'], () => {
        resolve(require('./kd/carReport'))
    })
}

// 工单消费归属对应
const workorderSalesAscriptionCom = resolve => {
        require.ensure(['./kd/workorderSalesAscription'], () => {
            resolve(require('./kd/workorderSalesAscription'))
        })
    }
    // 月度权重
const monthlyWeightCom = resolve => {
        require.ensure(['./kd/monthlyWeight'], () => {
            resolve(require('./kd/monthlyWeight'))
        })
    }
    // 问题项管理
const questionItemManagementCom = resolve => {
        require.ensure(['./kd/questionItemManagement'], () => {
            resolve(require('./kd/questionItemManagement'))
        })
    }
    // 问题分类管理
const questionTypeManagementCom = resolve => {
        require.ensure(['./kd/questionTypeManagement'], () => {
            resolve(require('./kd/questionTypeManagement'))
        })
    }
    // 问卷管理
const questionnaireManagementCom = resolve => {
        require.ensure(['./kd/questionnaireManagement'], () => {
            resolve(require('./kd/questionnaireManagement'))
        })
    }
    // 抱怨处理
const grievanceProcedureCom = resolve => {
    require.ensure(['./kd/grievanceProcedure'], () => {
        resolve(require('./kd/grievanceProcedure'))
    })
}

//数据共享车辆页面
const linkcarCom = resolve => {
	 require.ensure(['./link/linkcar'], () => {
        resolve(require('./link/linkcar'))
    })
}

// 4s回厂明细
const backDetailCom = resolve => {
	 require.ensure(['./link/backDetail'], () => {
        resolve(require('./link/backDetail'))
    })
}




//活动管理
//import activityManagement from './campaign/activityManagement'
const activityManagement = resolve => {
        require.ensure(['./campaign/activityManagement'], () => {
            resolve(require('./campaign/activityManagement'))
        })
    }
    //优惠券使用
    //import couponUseCom from './campaign/couponUseCom'
const couponUseCom = resolve => {
        require.ensure(['./campaign/couponUseCom'], () => {
            resolve(require('./campaign/couponUseCom'))
        })
    }
    //优惠券审批
    //import crmCouponApprovalPage from './campaign/crmCouponApprovalPage'
const crmCouponApprovalPage = resolve => {
        require.ensure(['./campaign/crmCouponApprovalPage'], () => {
            resolve(require('./campaign/crmCouponApprovalPage'))
        })
    }
    //优惠券管理
    //import couponManageCom from './campaign/couponManageCom'
const couponManageCom = resolve => {
    require.ensure(['./campaign/couponManageCom'], () => {
        resolve(require('./campaign/couponManageCom'))
    })
}

//优惠券补发
//import couponBuFaCom from './campaign/couponBuFa'
const couponBuFaCom = resolve => {
        require.ensure(['./campaign/couponBuFa'], () => {
            resolve(require('./campaign/couponBuFa'))
        })
    }
    //优惠券 列表
    //import couponBuFaListCom from './campaign/couponBuFaList'
const couponBuFaListCom = resolve => {
        require.ensure(['./campaign/couponBuFaList'], () => {
            resolve(require('./campaign/couponBuFaList'))
        })
    }
    //优惠券 激活
    //import couponActivationCom from './campaign/couponActivation'
const couponActivationCom = resolve => {
        require.ensure(['./campaign/couponActivation'], () => {
            resolve(require('./campaign/couponActivation'))
        })
    }
    //优惠券 使用日志
    //import couponUseLogCom from './campaign/couponUseLog'
const couponUseLogCom = resolve => {
    require.ensure(['./campaign/couponUseLog'], () => {
        resolve(require('./campaign/couponUseLog'))
    })
}



//活动分析
//import activityAnalysisCom from './KPI/activityAnalysis'
const activityAnalysisCom = resolve => {
        require.ensure(['./KPI/activityAnalysis'], () => {
            resolve(require('./KPI/activityAnalysis'))
        })
    }
    //SA过程管理
    //import processCom from './KPI/processCom'
const processCom = resolve => {
        require.ensure(['./KPI/processCom'], () => {
            resolve(require('./KPI/processCom'))
        })
    }
    //月度目标任务
    //import monthlyCom from './KPI/monthlyCom'
const monthlyCom = resolve => {
        require.ensure(['./KPI/monthlyCom'], () => {
            resolve(require('./KPI/monthlyCom'))
        })
    }
    //车辆回场率
    //import backCom from './KPI/backCom'
const backCom = resolve => {
        require.ensure(['./KPI/backCom'], () => {
            resolve(require('./KPI/backCom'))
        })
    }
    //SA工单匹配率
    //import matchingCom from './KPI/matchingCom'
const matchingCom = resolve => {
        require.ensure(['./KPI/matchingCom'], () => {
            resolve(require('./KPI/matchingCom'))
        })
    }
    //流失回厂率
    //import lostBackCom from './KPI/lostBackCom'
const lostBackCom = resolve => {
        require.ensure(['./KPI/lostBackCom'], () => {
            resolve(require('./KPI/lostBackCom'))
        })
    }
    //流失客户回访
    //import lostCustomerReturnCom from './KPI/lostCustomerReturnCom'
const lostCustomerReturnCom = resolve => {
        require.ensure(['./KPI/lostCustomerReturnCom'], () => {
            resolve(require('./KPI/lostCustomerReturnCom'))
        })
    }
    //保养回厂率
    //import maintenanceReturnCom from './KPI/maintenanceReturnCom'
const maintenanceReturnCom = resolve => {
    require.ensure(['./KPI/maintenanceReturnCom'], () => {
        resolve(require('./KPI/maintenanceReturnCom'))
    })
}


// 空组件， 标明路径跳转
import BaseCom from '../BaseCom'




// 定义子模块路由

// 定义子模块路由
const crmRoutes = [{
    path: 'crm',
    component: BaseCom,
    children: [
        //保险任务完成情况统计
        {
            path: 'KPI/insuranceTask',
            component: insuranceTaskCom
        },
        //基盘贡献分布
        {
            path: 'KPI/baseContribution',
            component: baseContribution
        },
        //基盘车辆车型分布
        {
            path: 'KPI/baseCarModel',
            component: baseCarModel
        },
        //基盘车辆年龄分布
        {
            path: 'KPI/baseCarAge',
            component: baseCarAge
        },
        //基盘车辆区域分布
        {
            path: 'KPI/baseCarArea',
            component: baseCarArea
        },
        {
            path: 'KPI/baseCarConsumption',
            component: baseCarConsumption
        },


        // 出保车辆到店率
        {
            path: 'KPI/cbCarBack',
            component: cbCarBack
        },
        // 出保车辆到店率
        {
            path: 'KPI/realBack',
            component: RealMaintainBackCom
        },
        {
            path: 'KPI/carTrendChsrts',
            component: carTrendChsrtsCom
        },
        {
            path: 'KPI/activityForRunXiang',
            component: activityForRunXiangCom
        },
        // 客户定保到店率
        {
            path: 'KPI/dbCarBack',
            component: dbCarBack
        },
        // 事故车流失率
        {
            path: 'KPI/carBack',
            component: carBack
        },
        // 流失月份分析
        {
            path: 'KPI/lostMonth',
            component: lostMonth
        },
        // 车辆流失分析
        {
            path: 'KPI/carLost',
            component: carLost
        },
        {
            path: 'KPI/outputValueStm',
            component: outputValueStmCom
        },



        {
            path: 'KPI/lostCarCharts',
            component: lostCarChartsCom
        },



        // //活动分析
        {
            path: 'KPI/activityAnalysis',
            component: activityAnalysisCom
        },
        //SA过程管理
        {
            path: 'KPI/process',
            component: processCom
        },
        //月度目标任务
        {
            path: 'KPI/monthly',
            component: monthlyCom
        },
        //车辆回厂率
        {
            path: 'KPI/back',
            component: backCom
        },
        //SA工单匹配率
        {
            path: 'KPI/matching',
            component: matchingCom
        },
        //流失回厂率
        {
            path: 'KPI/lostBack',
            component: lostBackCom
        },
        //流失客户回访
        {
            path: 'KPI/lostCustomerReturn',
            component: lostCustomerReturnCom
        },
        //保养回厂率
        {
            path: 'KPI/maintenanceReturn',
            component: maintenanceReturnCom
        },

        //活动管理导入
        {
            path: 'campaign/activity',
            component: activityManagement
        },
        //优惠券使用导入
        {
            path: 'campaign/coupon',
            component: couponUseCom
        },
        //优惠券审批
        {
            path: 'campaign/crmCouponApprovalPage',
            component: crmCouponApprovalPage
        },
        //优惠券管理导入
        {
            path: 'campaign/couponManage',
            component: couponManageCom
        },

        //优惠券补发
        {
            path: 'campaign/couponBuFa',
            component: couponBuFaCom
        },
        //补发列表
        {
            path: 'campaign/couponBuFaList',
            component: couponBuFaListCom
        },
        //优惠劵 激活
        {
            path: 'campaign/couponActivation',
            component: couponActivationCom
        },
        //优惠劵 使用日志
        {
            path: 'campaign/couponUseLog',
            component: couponUseLogCom
        },

        /*凯迪*/
        //客户等级管理
        {
            path: 'kd/customeManagementLevel',
            component: customeLevelManagementCom
        },
        // 客户评分项目管理
        {
            path: 'kd/customerManagementScore',
            component: customerScoreManagementCom
        },
        // 客户评级管理
        {
            path: 'kd/customerManagementRating',
            component: customerManagementRatingCom
        },
        // 客户评分项目评分分值管理
        {
            path: 'kd/customerValueSet',
            component: customerValueSetCom
        },
        // 车辆等级报表
        {
            path: 'kd/carReport',
            component: carReport
        },

        // 工单消费归属对应
        {
            path: 'kd/workorderSalesAscription',
            component: workorderSalesAscriptionCom
        },

        //月度权重管理
        {
            path: 'kd/monthlyWeight',
            component: monthlyWeightCom
        },
        // 问题项管理
        {
            path: 'kd/questionItemManagement',
            component: questionItemManagementCom
        },
        // 问题分类管理
        {
            path: 'kd/questionTypeManagement',
            component: questionTypeManagementCom

        },
        // 问卷管理
        {
            path: 'kd/questionnaireManagement',
            component: questionnaireManagementCom

        },
        // 抱怨处理
        {
            path: 'kd/grievanceProcedure',
            component: grievanceProcedureCom
        },
        
        // 数据共享页面
        {
            path: 'link/linkcar',
            component: linkcarCom
        },
        
        // 4s回厂明细
        {
            path: 'link/backDetail',
            component: backDetailCom
        }
        


    ].concat(datacenterRouter).concat(taskRoutes).concat(configRoutes).concat(customerRoutes).concat(dcRouter)

}];

export default crmRoutes